<div id="navibar">
    <?php if(null !== $this->categorySideBar()): ?>
    <h3>日志分类</h3>
    <div class="ul_list">
        <ul>
            <?php foreach ($this->categorySideBar() as $category) : ?>
            <li><a href="/category/<?php echo $this->escape($category->parent->categoryId) ?>-1.html" title="<?php echo $this->escape($category->parent->categoryDesc) ?>"><?php echo $this->escape($category->parent->categoryName) ?></a>
                    <?php if(property_exists($category, 'childs')) : ?>
                <ul>
                            <?php foreach ($category->childs as $child) : ?>
                    <li><a href="/category/<?php echo $this->escape($child->categoryId) ?>-1.html" title="<?php echo $this->escape($child->categoryDesc) ?>"><?php echo $this->escape($child->categoryName) ?></a></li>
                            <?php endforeach; ?>
                </ul>
                    <?php endif; ?>
            </li>
            <?php endforeach; ?>
        </ul>
    </div>
    <?php endif; ?>

    <h3>搜索文章</h3>
    <div class="ul_list">
        <form action="/search/keyword/" method="get" onsubmit="return checksubmit();">
        <p>
            <input type="text" name="keyword" size="18" style="height:22px" value="" /><br />
            <input type="submit" accesskey="4" value="搜一下" />
        </p>
        </form>
        <script type="text/javascript">
            function checksubmit(){
                if($('input[name=keyword]').val() == ''){
                    alert('告诉我,你想找点啥?');
                    $("#keyword").focus();
                    return false;
                }
                return true;
            }
        </script>
    </div>

    <?php if(null !== $this->newestSideBar()): ?>
    <h3>最近文章</h3>
    <div class="ul_list">
        <ul>
            <?php foreach ($this->newestSideBar() as $newest) : ?>
            <li><a href="/article/<?php echo $this->escape($newest->articleId) ?>-1.html" title="查看 <?php echo $this->escape($newest->articleTitle) ?> "><?php echo $this->escape($newest->articleTitle) ?></a></li>
            <?php endforeach; ?>
        </ul>
    </div>
    <?php endif; ?>

    <?php if(null !== $this->hottestSideBar()): ?>
    <h3>最被关注</h3>
    <div class="ul_list">
        <ul>
            <?php foreach ($this->hottestSideBar() as $hottest) : ?>
            <li><a href="/article/<?php echo $this->escape($hottest->articleId) ?>-1.html" title="查看 <?php echo $this->escape($hottest->articleTitle) ?> "><?php echo $this->escape($hottest->articleTitle) ?></a></li>
            <?php endforeach; ?>
        </ul>
    </div>
    <?php endif; ?>

    <?php if(null !== $this->archiveSideBar()): ?>
    <h3>日志归档</h3>
    <div class="ul_list">
        <ul>
            <?php foreach ($this->archiveSideBar() as $archive) : ?>
            <li><a href="/archive/<?php echo $this->escape($archive->publishDate) ?>/1.html" title="查看<?php echo $this->escape($archive->dateString) ?>所有文章"><?php echo $this->escape($archive->dateString) ?></a></li>
            <?php endforeach; ?>
        </ul>
    </div>
    <?php endif; ?>
</div>
